﻿@{
    ViewBag.Title = "微信用户绑定 ";
    Layout = "~/Areas/WeiXinAreas/Views/Shared/_LayoutWeui.cshtml";
}

    <!-- 字体图标 -->
    <link rel="stylesheet" href="~/Content/M/css/iconfonts.css" />
    <style>
        html, body {
            background-color: #fff; /*rgb(236,236,236);*/
        }

        .form-field {
            clear: both;
            width: 320px;
            margin: 0 auto;
            padding-top: 10px;
        }

            .form-field input {
                width: 306px;
                height: 28px;
                border: none;
                border-bottom: 1px solid #d8d8d8;
                font-size: 14px;
                color: #666;
                line-height: 28px;
                padding: 6px 0 6px 12px;
                /*border-radius: 4px;
                box-shadow: 0 0 5px #fff;
                outline: none;
                transition: box-shadow 0.25s linear 0s;
                -webkit-transition: box-shadow 0.25s linear 0s;*/
            }

        .form-link {
            clear: both;
            width: 320px;
            margin: 0 auto;
            padding: 8px 0 0;
            text-align: right;
            font-size: 14px;
        }

        .submit-btn {
            width: 320px;
            margin: 0 auto;
            padding: 12px 0 0;
        }

            .submit-btn input {
                width: 320px;
                height: 42px;
                border: none;
                background-color: #35a4fe;
                border-radius: 10px;
                text-align: center;
                line-height: 40px;
                color: #fff;
                font-size: 18px;
                font-weight: bold;
                cursor: pointer;
            }

        .form-link a {
            color: #35a4fe;
        }

        /*.weui-cell:before {
            border: none;
        }*/
         .weui-cell:before{
           left:0.2rem;
        }
        .weui-cells:before{
            border-top:none;
        }
        .weui-cells:after{
            margin-left:0.2rem;
        }
        .weui-cells_checkbox .weui-check:checked + .weui-icon-checked:before {
            color: #35a4fe;
        }
        .weui-label{
            width:70px;
        }
    </style>

<div style="margin-top:2rem;">
    <form id="loginForm" method="post">

        @*<div >
                <div class="form-field" style="text-align:center;margin-bottom:2rem;">
                    <img src="~/Content/M/img/logo.png" style="width:12rem;" />
                </div>
                <div class="form-field">
                   <input name="userName" type="text" placeholder="请输入您的账号">
                </div>
                <div class="form-field">
                   <input name="password" type="password" placeholder="请输入您的密码">
                </div>
            </div>*@

        <div class="form-field" style="text-align:center;margin-bottom:2rem;">
            <img src="~/Content/M/img/logo204.jpg" style="width:12rem;" />
        </div>
        <div class="weui-cells weui-cells_form" style="font-size:0.7rem;margin-top:45px;width:320px;margin-left:auto;margin-right:auto;">
            <div class="weui-cell" >
                <div class="weui-cell__hd"><label class="weui-label">账号</label></div>
                <div class="weui-cell__bd">
                    <input id="userName" name="userName" class="weui-input" type="text" placeholder="请输入您的账号">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">密码</label></div>
                <div class="weui-cell__bd">
                    <input id="password" name="password" class="weui-input" type="password" placeholder="请输入您的密码">
                </div>
            </div>
        </div>
        <input type="hidden" value="@ViewData["openId"]" name="openId" />
        <div class="submit-btn" style="margin-top: 1rem">
            <input type="button" id="btnSubmit" value="登 录" />
        </div>
    </form>
</div>
@section footScript
{
    <script src="/Content/js/md5/jquery.md5.js"></script>
    <script>
        $(function () {
            var $btn = $('#btnSubmit');
            $('#btnSubmit').click(function (e) {
                e.preventDefault();
                $btn.val('正在登录...');
                $.ajax({
                    type: "post",
                    url: "doLogin",
                    data: { "userName": $.trim($("#userName").val()), "password": $.md5($.trim($("#password").val())) },
                    dataType: "text",
                    success: function (json) {
                        if (json.toString().indexOf("success")>-1)
                        {
                            $btn.val('绑定成功，跳转中...');
                            setTimeout(function () {
                                location.replace('Ponser');
                            }, 800);
                        } else {
                            $btn.val('登 录');
                            $.alert(json.substr(6));
                        }
                    }
                });
            });
        });
    </script>
}